package cn.ddiancan.xddcloud.common.context;

public class RequestContextManager {

    private static final ThreadLocal<RequestContext> threadLocal = new ThreadLocal<>();

    public static RequestContext getRequestContext() {
        return threadLocal.get();
    }

    public static void setRequestContext(RequestContext requestContext) {
        threadLocal.set(requestContext);
    }

    public static void releaseRequestContext() {
        threadLocal.remove();
    }

    public static void constructRequestContext(RequestContext requestContext) {
        setRequestContext(requestContext);
    }
}
